<%@ Page Title="" Language="C#" MasterPageFile="~/Admin/admin.master" AutoEventWireup="true" CodeFile="HoaDon.aspx.cs" Inherits="Admin_HoaDon" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <script type="text/javascript">
        $(document).ready(function () {
            activeMenu(6, 0);
            $("#<%=txtNgayLap.ClientID%>").datepicker({ dateFormat: "dd/mm/yy", maxDate: "+0D" });
        });
    </script>
    <div class="divsize">
        <fieldset>
            <legend>Hoa Don</legend>
            <asp:Label ID="messageKetQua" runat="server" Enabled="false"></asp:Label>
            <%--panel hiển thị Hóa đơn--%>
            <asp:Panel ID="panelHoaDon" runat="server">
                <ol class="form form-clear">
                    <li>
                        <label>Ma hoa don</label>
                        <asp:TextBox ID="txtMaHD" runat="server"></asp:TextBox>
                    </li>
                    <li>
                        <label>Ma nhan vien kt</label>
                        <asp:DropDownList ID="cbMaNVKT" runat="server" Width="210px"></asp:DropDownList>
                    </li>
                    <li>
                        <label>Ma be</label>
                        <asp:DropDownList ID="cbMaBe" runat="server" Width="210px"></asp:DropDownList>
                    </li>
                    <li>
                        <label>Ngay lap</label>
                        <asp:TextBox ID="txtNgayLap" runat="server"></asp:TextBox>
                    </li>
                    <li>
                        <label>Tong tien</label>
                        <asp:TextBox ID="txtTongTien" runat="server"></asp:TextBox>
                    </li>
                    <li>
                        <asp:Button ID="btnThem" Text="Them moi" runat="server" CssClass="btn primary" OnClick="btnThem_Click" />
                        <asp:Button ID="btnSua" Text="Sua" runat="server" CssClass="btn primary" Enabled="false" OnClick="btnSua_Click" />
                    </li>
                </ol>
            </asp:Panel>
        </fieldset>
    </div>
    <div>
        <fieldset>
            <legend>Danh sach</legend>
            <asp:ListView ID="ListViewHoaDon" runat="server"
                          OnItemCommand="ListViewHoaDon_OnItemCommand"
                          OnItemDeleting="ListViewHoaDon_OnItemDeleting"
                          OnItemUpdating="ListViewHoaDon_OnItemUpdating">
                <LayoutTemplate>
                    <table border="1">
                        <tr>
                            <th>Ma hoa don</th>
                            <th>Ma nhan vien ke toan</th>
                            <th>Ma be</th>
                            <th>Ngay lap</th>
                            <th>Tong tien</th>
                            <th>Thao tac</th>
                        </tr>
                        <asp:PlaceHolder ID="itemPlaceholder" runat="server"></asp:PlaceHolder>
                    </table>
                    <asp:DataPager ID="HoaDonDataPager" runat="server" PageSize="10">
                        <Fields>
                            <asp:NextPreviousPagerField ButtonType="Button"
                                ShowFirstPageButton="true"
                                ShowNextPageButton="false"
                                ShowPreviousPageButton="false" />
                            <asp:NumericPagerField ButtonCount="10" />
                            <asp:NextPreviousPagerField ButtonType="Button"
                                ShowLastPageButton="true"
                                ShowNextPageButton="false"
                                ShowPreviousPageButton="false" />
                        </Fields>
                    </asp:DataPager>
                </LayoutTemplate>
                <ItemTemplate>
                    <tr>
                        <td><%# Eval("MaHD") %></td>
                        <td><%# Eval("MaNVKT") %></td>
                        <td><%# Eval("MaBe") %></td>
                        <td><%# Eval("NgayLap") %></td>
                        <td><%# Eval("TongTien") %></td>
                        <td>
                            <asp:LinkButton ID="LinkButtonSua" 
                                ToolTip="Sửa thông tin" 
                                runat="server" 
                                CommandArgument='<%# Eval("MaHD") %>'
                                CommandName="Update">Sua</asp:LinkButton>
                            |
                            <asp:LinkButton ID="LinkButtonXoa" 
                                ToolTip="Xóa một bản ghi" 
                                runat="server" 
                                CommandArgument='<%# Eval("MaHD") %>'
                                CommandName="Delete" 
                                ForeColor="Brown" 
                                OnClientClick="return confirm('Ban co chac chan muon xoa ?')">Xoa</asp:LinkButton>
                            |
                            <a href='ChiTietHoaDon.aspx?id=<%# Eval("MaHD") %>'>Chi tiet</a>
                        </td>
                    </tr>
                </ItemTemplate>
            </asp:ListView>
        </fieldset>
    </div>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder2" Runat="Server">
    <ul class="m-melanin-vertical-navigation">
         <li>
                <span class=" ss_sprite ss_shield">&nbsp;</span>
                <a id="A4" href="HoaDon.aspx" class="m-melanin-vertical-navigation-link">Hoa don</a>
          </li>
    </ul>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="ContentPlaceHolder3" Runat="Server">
    <asp:Button ID="button_create_hoadon" runat="server" CssClass="btn small primary" Text="Them hoa don" />
</asp:Content>

